import 'package:flutter/material.dart';

import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:niu_app/configs/app_style_config.dart';
import 'package:niu_app/pages/model/homepage/niu_account_model.dart';
import 'package:niu_app/views/homepage/niu_account_widget.dart';
import 'package:niu_app/views/jk/jk_text.dart';

class niu_account_Page extends StatefulWidget {
  @override
  _niu_account_PageState createState() => _niu_account_PageState();
}

class _niu_account_PageState extends State<niu_account_Page> {

  List notice=[
    {
      "url":"assets/boy1.png",
      "title":"OKEX",
      "title1":"币本位永续合约",
      "title2":"BTC/USD",
      "number1":"12,345.00",
      "number2":"12,345.00",
      "number3":"12,345.00",
      "number4":"70",
      "number5":"12,345.00",
      "number6":"70",
      "number7":"12,345.00"
    },
    {
      "url":"assets/boy1.png",
      "title":"火币",
      "title1":"金本位永续合约",
      "title2":"BTC/USD",
      "number1":"12,345.00",
      "number2":"12,345.00",
      "number3":"12,345.00",
      "number4":"70",
      "number5":"12,345.00",
      "number6":"70",
      "number7":"12,345.00"
    },

  ];

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 300.h,
      color: AppStyleConfig.color6,
      child: Column(
        children: [
          top(),
         MediaQuery.removePadding(
             context: context,
             removeTop: true,
             child:  ListView.builder(
               shrinkWrap: true,
               scrollDirection: Axis.vertical,
               physics:NeverScrollableScrollPhysics(),
               itemBuilder: (context,index){
                 return NiuaccountWidget(
                   dataModel: niuAccountModel.fromJson(notice[index]),
                 );
               },
               itemCount: notice.length,
             ),)
        ],
      ),
    );
  }
  Widget top(){
    return Container(
      height:87.w,
      width: 359.w,
      color: AppStyleConfig.color6,
      margin: EdgeInsets.only(top: 8.w,bottom: 8.w),
      child:Card(
        child: Container(
          padding: EdgeInsets.fromLTRB(16, 18, 16, 18),
          decoration: BoxDecoration(
              color: AppStyleConfig.background,
              borderRadius: BorderRadius.all(Radius.circular(2))
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  Container(
                    height: 24,
                    width:  24,
                    decoration: BoxDecoration(
                        color: AppStyleConfig.TextColor,
                        borderRadius: BorderRadiusDirectional.all(Radius.circular(75))
                    ),
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Icon(Icons.person,color: AppStyleConfig.background,),

                      ],
                    ),
                  ),
                  SizedBox(width: 5,),
                  JKText(
                    data: "注册账户",
                    color: AppStyleConfig.TextColor,
                    fontSize: 16.w,
                  )
                ],
              ),
              Row(
                children: [
                  JKText(
                    data: "注册新的API账户",
                    color: AppStyleConfig.color1,
                    fontSize: 10.w,
                  ),
                  Icon(Icons.chevron_right,color: AppStyleConfig.TextColor,size: 14.w,)
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
